home *** CD-ROM | disk | FTP | other *** search
/ Freelog 70 / Freelog070.iso / Internet / EasyPHP / easyphp1-8_setup.exe / {app} / phpmyadmin / libraries / display_export.lib.php < prev    next >
Encoding:
PHP Script  |  2004-12-28  |  38.5 KB  |  687 lines

  1. <?php
  2. /* $Id: display_export.lib.php,v 2.25 2004/12/28 12:54:39 nijel Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. // Get relations & co. status
  6. require_once('./libraries/relation.lib.php');
  7. $cfgRelation = PMA_getRelationsParam();
  8.  
  9. // Check if we have native MS Excel export using PEAR class Spreadsheet_Excel_Writer
  10. if (!empty($GLOBALS['cfg']['TempDir'])) {
  11.     @include_once('Spreadsheet/Excel/Writer.php');
  12.     if (class_exists('Spreadsheet_Excel_Writer')) {
  13.         $xls = TRUE;
  14.     } else {
  15.         $xls = FALSE;
  16.     }
  17. } else {
  18.     $xls = FALSE;
  19. }
  20.  
  21. function PMA_exportCheckboxCheck($str) {
  22.     if (isset($GLOBALS['cfg']['Export'][$str]) && $GLOBALS['cfg']['Export'][$str]) {
  23.         echo ' checked="checked"';
  24.     }
  25. }
  26.  
  27. function PMA_exportIsActive($what, $val) {
  28.     if (isset($GLOBALS['cfg']['Export'][$what]) &&  $GLOBALS['cfg']['Export'][$what] == $val) {
  29.         echo ' checked="checked"';
  30.     }
  31. }
  32.  
  33. ?>
  34. <form method="post" action="export.php" name="dump">
  35. <?php
  36. $hide_structure = false;
  37. $hide_sql       = false;
  38. $hide_xml       = empty($db);
  39. if ($export_type == 'server') {
  40.     echo PMA_generate_common_hidden_inputs('', '', 1);
  41. } elseif ($export_type == 'database') {
  42.     echo PMA_generate_common_hidden_inputs($db, '', 1);
  43. } else {
  44.     echo PMA_generate_common_hidden_inputs($db, $table, 1);
  45.     if (!isset($single_table)) {
  46.         $hide_structure = true;
  47.         $hide_sql       = true;
  48.     } else {
  49.         // just to keep this value for possible next display of this form after saving on server
  50.         echo '    <input type="hidden" name="single_table" value="TRUE" />';
  51.     }
  52. }
  53. echo '    <input type="hidden" name="export_type" value="' . $export_type . '" />';
  54.  
  55. if (isset($sql_query)) {
  56.     echo '    <input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />';
  57. }
  58. ?>
  59.  
  60.     <script type="text/javascript">
  61.     <!--
  62.     function hide_them_all() {
  63.         getElement("csv_options").style.display = 'none';
  64.         getElement("excel_options").style.display = 'none';
  65.         getElement("latex_options").style.display = 'none';
  66. <?php if ($xls) { ?>
  67.         getElement("xls_options").style.display = 'none';
  68. <?php } ?>
  69. <?php if (!$hide_sql) { ?>
  70.         getElement("sql_options").style.display = 'none';
  71. <?php } ?>
  72.         getElement("none_options").style.display = 'none';
  73.     }
  74.  
  75.     function show_checked_option() {
  76.         hide_them_all();
  77.         if (getElement('radio_dump_latex').checked) {
  78.             getElement('latex_options').style.display = 'block';
  79. <?php if ($xls) { ?>
  80.         } else if (getElement('radio_dump_xls').checked) {
  81.             getElement('xls_options').style.display = 'block';
  82. <?php } ?>
  83. <?php if (!$hide_sql) { ?>
  84.         } else if (getElement('radio_dump_sql').checked) {
  85.             getElement('sql_options').style.display = 'block';
  86. <?php } ?>
  87. <?php if (!$hide_xml) { ?>
  88.         } else if (getElement('radio_dump_xml').checked) {
  89.             getElement('none_options').style.display = 'block';
  90. <?php } ?>
  91.         } else if (getElement('radio_dump_csv').checked) {
  92.             getElement('csv_options').style.display = 'block';
  93.         } else if (getElement('radio_dump_excel').checked) {
  94.             getElement('excel_options').style.display = 'block';
  95.         } else {
  96.             if (getElement('radio_dump_sql')) {
  97.                 getElement('radio_dump_sql').checked = true;
  98.                 getElement('sql_options').style.display = 'block';
  99.             } else if (getElement('radio_dump_csv')) {
  100.                 getElement('radio_dump_csv').checked = true;
  101.                 getElement('csv_options').style.display = 'block';
  102.             } else {
  103.                 getElement('none_options').style.display = 'block';
  104.             }
  105.         }
  106.     }
  107.     //-->
  108.     </script>
  109.  
  110.     <table cellpadding="3" border="0" cellspacing="0">
  111.     <tr>
  112.         <th colspan="3" valign="top" nowrap="nowrap" class="tblHeaders"><?php echo $export_page_title; ?></th>
  113.     </tr>
  114.     <tr>
  115.         <!-- Formats to export to -->
  116.         <td nowrap="nowrap" valign="top" onclick="if (typeof(window.opera) != 'undefined')setTimeout('show_checked_option()', 1); return true">
  117.             <table border="0" cellpadding="3" cellspacing="1">
  118.                 <tr><th align="left"><?php echo $strExport; ?></th></tr>
  119.             <?php
  120.             if (isset($multi_values) && $multi_values != '') {
  121.                 echo '                <tr><td bgcolor="' . $cfg['BgcolorOne'] . '">';
  122.                 echo $multi_values;
  123.                 echo '                </td></tr>';
  124.             }
  125.             ?>
  126.  
  127. <?php if (!$hide_sql) { ?>
  128.             <!-- SQL -->
  129.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  130.                     <input type="radio" name="what" value="sql" id="radio_dump_sql" onclick="if (this.checked) { hide_them_all(); getElement('sql_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'sql'); ?> style="vertical-align: middle" /><label for="radio_dump_sql"><?php echo $strSQL; ?> </label>
  131.                 </td></tr>
  132. <?php } ?>
  133.  
  134.             <!-- LaTeX table -->
  135.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  136.                     <input type="radio" name="what" value="latex" id="radio_dump_latex"  onclick="if (this.checked) { hide_them_all(); getElement('latex_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'latex'); ?> style="vertical-align: middle" /><label for="radio_dump_latex"><?php echo $strLaTeX; ?> </label>
  137.                 </td></tr>
  138.  
  139.  
  140. <?php if ($xls) { ?>
  141.             <!-- Native Excel -->
  142.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  143.                     <input type="radio" name="what" value="xls" id="radio_dump_xls"  onclick="if (this.checked) { hide_them_all(); getElement('xls_options').style.display = 'block'; getElement('checkbox_dump_asfile').checked = true;};  return true" <?php PMA_exportIsActive('format', 'xls'); ?> /><label for="radio_dump_xls"><?php echo $strStrucNativeExcel; ?></label>
  144.                </td></tr>
  145. <?php } ?>
  146.  
  147.             <!-- Excel CSV -->
  148.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  149.                     <input type="radio" name="what" value="excel" id="radio_dump_excel"  onclick="if (this.checked) { hide_them_all(); getElement('excel_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'excel'); ?> style="vertical-align: middle" /><label for="radio_dump_excel"><?php echo $strStrucExcelCSV; ?> </label>
  150.                 </td></tr>
  151.  
  152.             <!-- General CSV -->
  153.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  154.                     <input type="radio" name="what" value="csv" id="radio_dump_csv"  onclick="if (this.checked) { hide_them_all(); getElement('csv_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'csv'); ?> style="vertical-align: middle" /><label for="radio_dump_csv"><?php echo $strStrucCSV;?> </label>
  155.                 </td></tr>
  156.  
  157. <?php if (!$hide_xml) { ?>
  158.             <!-- XML -->
  159.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  160.                     <input type="radio" name="what" value="xml" id="radio_dump_xml" onclick="if (this.checked) { hide_them_all(); getElement('none_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'xml'); ?> style="vertical-align: middle" /><label for="radio_dump_xml"><?php echo $strXML; ?> </label>
  161.                 </td></tr>
  162. <?php } ?>
  163.             </table>
  164.         </td>
  165.         <!-- ltr item -->
  166.         <td valign="top"><img src="<?php echo $pmaThemeImage . 'item_ltr.png'; ?>" border="0" hspace="2" vspace="5" /></td>
  167.         <!-- Options -->
  168.         <td valign="top" id="options_td" width="400">
  169.  
  170. <?php if (!$hide_sql) { ?>
  171.             <!-- SQL options -->
  172.             <div id="sql_options">
  173.             <table width="400" border="0" cellpadding="3" cellspacing="1">
  174.                 <tr>
  175.                     <th align="left">
  176.                     <?php
  177.                     echo $strSQLOptions;
  178.                     $goto_documentation = '<a href="./Documentation.html#faqexport" target="documentation">';
  179.                     echo ($cfg['ReplaceHelpImg'] ? '' : '(')
  180.                        . $goto_documentation
  181.                        . ($cfg['ReplaceHelpImg'] ? '<img src="' . $pmaThemeImage . 'b_help.png" border="0" alt="' .$strDocu . '" width="11" height="11" hspace="2" align="middle" />' : $strDocu)
  182.                        . '</a>' . ($cfg['ReplaceHelpImg'] ? '' : ')');
  183.                     ?>
  184.                     </th>
  185.                 </tr>
  186.                 <tr>
  187.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  188.                         <?php echo $strAddHeaderComment; ?>: <input type="text" name="header_comment" value="<?php echo $cfg['Export']['sql_header_comment']; ?>" class="textfield" size="30" style="vertical-align: middle" /><br />
  189.                         <input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" <?php PMA_exportCheckboxCheck('sql_use_transaction'); ?> style="vertical-align: middle" /><label for="checkbox_use_transaction"><?php echo $strEncloseInTransaction; ?></label><br />
  190.  
  191.                         <input type="checkbox" name="disable_fk" value="yes" id="checkbox_disable_fk" <?php PMA_exportCheckboxCheck('sql_disable_fk'); ?> style="vertical-align: middle" /><label for="checkbox_disable_fk"><?php echo $strDisableForeignChecks; ?></label><br />
  192.                     </td>
  193.                 </tr>
  194. <?php
  195. if ($export_type == 'server') {
  196. ?>
  197.                 <!-- For databases -->
  198.                 <tr>
  199.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  200.                         <b><?php echo $strDatabaseExportOptions; ?>:</b><br />
  201.                         <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" <?php PMA_exportCheckboxCheck('sql_drop_database'); ?> style="vertical-align: middle" /><label for="checkbox_drop_database"><?php echo $strAddDropDatabase; ?></label>
  202.                     </td>
  203.                 </tr>
  204.  
  205. <?php
  206. }
  207. if (!$hide_structure) { ?>
  208.                 <!-- For structure -->
  209.                 <tr>
  210.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  211.                         <input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" <?php PMA_exportCheckboxCheck('sql_structure'); ?> onclick="if (!this.checked && !getElement('checkbox_sql_data').checked) return false; else return true;" /><label for="checkbox_sql_structure"><b><?php echo $strStructure; ?>:</b></label><br />
  212.  
  213.                             <input type="checkbox" name="drop" value="1" id="checkbox_dump_drop" <?php PMA_exportCheckboxCheck('sql_drop_table'); ?> style="vertical-align: middle" /><label for="checkbox_dump_drop"><?php echo $strStrucDrop; ?></label><br />
  214.  
  215.                             <input type="checkbox" name="if_not_exists" value="1" id="checkbox_dump_if_not_exists" <?php PMA_exportCheckboxCheck('sql_if_not_exists'); ?> style="vertical-align: middle" /><label for="checkbox_dump_if_not_exists"><?php echo $strAddIfNotExists; ?></label><br />
  216.  
  217.                             <input type="checkbox" name="auto_increment" value="1" id="checkbox_auto_increment" <?php PMA_exportCheckboxCheck('sql_auto_increment'); ?> style="vertical-align: middle" /><label for="checkbox_auto_increment"><?php echo $strAddAutoIncrement; ?></label><br />
  218.  
  219.                             <input type="checkbox" name="use_backquotes" value="1" id="checkbox_dump_use_backquotes" <?php PMA_exportCheckboxCheck('sql_backquotes'); ?> style="vertical-align: middle" /><label for="checkbox_dump_use_backquotes"><?php echo $strUseBackquotes; ?></label><br />
  220.  
  221.                             <b><?php echo $strAddIntoComments; ?></b><br />
  222.  
  223.                                 <input type="checkbox" name="sql_dates" value="yes" id="checkbox_sql_dates" <?php PMA_exportCheckboxCheck('sql_dates'); ?> style="vertical-align: middle" /><label for="checkbox_sql_dates"><?php echo $strCreationDates; ?></label><br />
  224. <?php
  225.     if (!empty($cfgRelation['relation'])) {
  226. ?>
  227.                                 <input type="checkbox" name="sql_relation" value="yes" id="checkbox_sql_use_relation" <?php PMA_exportCheckboxCheck('sql_relation'); ?> style="vertical-align: middle" /><label for="checkbox_sql_use_relation"><?php echo $strRelations; ?></label><br />
  228. <?php
  229.     } // end relation
  230.     if (!empty($cfgRelation['commwork'])) {
  231. ?>
  232.                                 <input type="checkbox" name="sql_comments" value="yes" id="checkbox_sql_use_comments" <?php PMA_exportCheckboxCheck('sql_comments'); ?> style="vertical-align: middle" /><label for="checkbox_sql_use_comments"><?php echo $strComments; ?></label><br />
  233. <?php
  234.     } // end comments
  235.     if ($cfgRelation['mimework']) {
  236. ?>
  237.                                 <input type="checkbox" name="sql_mime" value="yes" id="checkbox_sql_use_mime" <?php PMA_exportCheckboxCheck('sql_mime'); ?> style="vertical-align: middle" /><label for="checkbox_sql_use_mime"><?php echo $strMIME_MIMEtype; ?></label><br />
  238. <?php
  239.     } // end MIME
  240.     if (PMA_MYSQL_INT_VERSION >= 40100) {
  241. ?>
  242.                         <label for="select_sql_compat"><?php echo $strSQLExportCompatibility; ?>: </label><select name="sql_compat" id="select_sql_compat" style="vertical-align: middle">
  243.                         <?php
  244.                         /* FIXME: offer only those that have effect on actual version? */
  245.                         $compats = array('NONE', 'ANSI', 'DB2', 'MAXDB', 'MSSQL', 'MYSQL323', 'MYSQL40', 'ORACLE', 'POSTGRESQL', 'TRADITIONAL');
  246.                         foreach ($compats as $x) {
  247.                             echo '<option value="' . $x . '"' . ($cfg['Export']['sql_compat'] == $x ? ' selected="selected"' : '' ) . '>' . $x . '</option>' . "\n";
  248.                         }
  249.                         ?>
  250.                         </select>
  251.                         <?php echo PMA_showMySQLDocu('manual_MySQL_Database_Administration', 'Server_SQL_mode') . "\n"; 
  252.     }
  253.     ?>
  254.                     </td>
  255.                 </tr>
  256. <?php
  257. } // end STRUCTURE
  258. ?>
  259.  
  260.                 <!-- For data -->
  261.                 <tr>
  262.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  263.                         <input type="checkbox" name="sql_data" value="data" id="checkbox_sql_data" <?php PMA_exportCheckboxCheck('sql_data'); ?> onclick="if (!this.checked && (!getElement('checkbox_sql_structure') || !getElement('checkbox_sql_structure').checked)) return false; else return true;" style="vertical-align: middle" /><label for="checkbox_sql_data"><b><?php echo $strData; ?>:</b></label><br />
  264.  
  265.                             <input type="checkbox" name="showcolumns" value="yes" id="checkbox_dump_showcolumns" <?php PMA_exportCheckboxCheck('sql_columns'); ?> style="vertical-align: middle" /><label for="checkbox_dump_showcolumns"><?php echo $strCompleteInserts; ?></label><br />
  266.  
  267.                             <input type="checkbox" name="extended_ins" value="yes" id="checkbox_dump_extended_ins" <?php PMA_exportCheckboxCheck('sql_extended'); ?> style="vertical-align: middle" /><label for="checkbox_dump_extended_ins"><?php echo $strExtendedInserts; ?></label><br />
  268.  
  269.                             <input type="checkbox" name="delayed" value="yes" id="checkbox_dump_delayed" <?php PMA_exportCheckboxCheck('sql_delayed'); ?> style="vertical-align: middle" /><label for="checkbox_dump_delayed"><?php echo $strDelayedInserts; ?></label><br />
  270.  
  271.                             <input type="checkbox" name="sql_ignore" value="yes" id="checkbox_dump_ignore" <?php PMA_exportCheckboxCheck('sql_ignore'); ?> style="vertical-align: middle" /><label for="checkbox_dump_ignore"><?php echo $strIgnoreInserts; ?></label><br />
  272.  
  273.                             <input type="checkbox" name="hexforbinary" value="yes" id="checkbox_hexforbinary" <?php PMA_exportCheckboxCheck('sql_hex_for_binary'); ?> style="vertical-align: middle" /><label for="checkbox_hexforbinary"><?php echo $strHexForBinary; ?></label><br />
  274.  
  275.                         <label for="select_sql_type"><?php echo $strSQLExportType; ?>: </label><select name="sql_type" id="select_sql_type" style="vertical-align: middle">
  276.                             <option value="insert"<?php echo $cfg['Export']['sql_type'] == 'insert' ? ' selected="selected"' : ''; ?>>INSERT</option>
  277.                             <option value="update"<?php echo $cfg['Export']['sql_type'] == 'update' ? ' selected="selected"' : ''; ?>>UPDATE</option>
  278.                             <option value="replace"<?php echo $cfg['Export']['sql_type'] == 'replace' ? ' selected="selected"' : ''; ?>>REPLACE</option>
  279.                         </select>
  280.                     </td>
  281.                 </tr>
  282.                 </table>
  283.             </div>
  284. <?php
  285. } // end SQL-OPTIONS
  286. ?>
  287.  
  288.             <!-- LaTeX options -->
  289.             <div id="latex_options">
  290.             <table width="400" border="0" cellpadding="3" cellspacing="1">
  291.                 <tr><th align="left"><?php echo $strLaTeXOptions; ?></th></tr>
  292.                 <tr>
  293.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  294.                         <input type="checkbox" name="latex_caption" value="yes" id="checkbox_latex_show_caption" <?php PMA_exportCheckboxCheck('latex_caption'); ?> style="vertical-align: middle" /><label for="checkbox_latex_show_caption"><?php echo $strLatexIncludeCaption; ?></label><br />
  295.                     </td>
  296.                 </tr>
  297.  
  298. <?php if (!$hide_structure) { ?>
  299.                 <!-- For structure -->
  300.                 <tr>
  301.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  302.                     <input type="checkbox" name="latex_structure" value="structure" id="checkbox_latex_structure" <?php PMA_exportCheckboxCheck('latex_structure'); ?> onclick="if (!this.checked && !getElement('checkbox_latex_data').checked) return false; else return true;" style="vertical-align: middle" /><label for="checkbox_latex_structure"><b><?php echo $strStructure; ?></b></label><br />
  303.                     <table border="0" cellspacing="1" cellpadding="0">
  304.                         <tr>
  305.                             <td>     </td>
  306.                             <td><?php echo $strLatexCaption; ?> </td>
  307.                             <td>
  308.                                 <input type="text" name="latex_structure_caption" size="30" value="<?php echo $strLatexStructure; ?>" class="textfield" style="vertical-align: middle" />
  309.                             </td>
  310.                         </tr>
  311.                         <tr>
  312.                             <td> </td>
  313.                             <td><?php echo $strLatexContinuedCaption; ?> </td>
  314.                             <td>
  315.                                 <input type="text" name="latex_structure_continued_caption" size="30" value="<?php echo $strLatexStructure . ' ' . $strLatexContinued; ?>" class="textfield" style="vertical-align: middle" />
  316.                             </td>
  317.                         </tr>
  318.                         <tr>
  319.                             <td> </td>
  320.                             <td><?php echo $strLatexLabel; ?> </td>
  321.                             <td>
  322.                                 <input type="text" name="latex_structure_label" size="30" value="<?php echo $cfg['Export']['latex_structure_label']; ?>" class="textfield" style="vertical-align: middle" />
  323.                             </td>
  324.                         </tr>
  325.                     </table>
  326. <?php
  327.     if (!empty($cfgRelation['relation'])) {
  328. ?>
  329.                         <input type="checkbox" name="latex_relation" value="yes" id="checkbox_latex_use_relation" <?php PMA_exportCheckboxCheck('latex_relation'); ?> style="vertical-align: middle" /><label for="checkbox_latex_use_relation"><?php echo $strRelations; ?></label><br />
  330. <?php
  331.     } // end relation
  332.     if ($cfgRelation['commwork']) {
  333. ?>
  334.                         <input type="checkbox" name="latex_comments" value="yes" id="checkbox_latex_use_comments" <?php PMA_exportCheckboxCheck('latex_comments'); ?> style="vertical-align: middle" /><label for="checkbox_latex_use_comments"><?php echo $strComments; ?></label><br />
  335. <?php
  336.     } // end comments
  337.     if ($cfgRelation['mimework']) {
  338. ?>
  339.                         <input type="checkbox" name="latex_mime" value="yes" id="checkbox_latex_use_mime" <?php PMA_exportCheckboxCheck('latex_mime'); ?> style="vertical-align: middle" /><label for="checkbox_latex_use_mime"><?php echo $strMIME_MIMEtype; ?></label><br />
  340. <?php
  341.     } // end MIME
  342. ?>
  343.                 </td>
  344.             </tr>
  345. <?php
  346. } // end STRUCTURE
  347. ?>
  348.             <!-- For data -->
  349.             <tr>
  350.                 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  351.                     <input type="checkbox" name="latex_data" value="data" id="checkbox_latex_data" <?php PMA_exportCheckboxCheck('latex_data'); ?> onclick="if (!this.checked && (!getElement('checkbox_latex_structure') || !getElement('checkbox_latex_structure').checked)) return false; else return true;" style="vertical-align: middle" /><label for="checkbox_latex_data"><b><?php echo $strData; ?>:</b></label><br />
  352.                         <input type="checkbox" name="latex_showcolumns" value="yes" id="ch_latex_showcolumns" <?php PMA_exportCheckboxCheck('latex_columns'); ?> style="vertical-align: middle" /><label for="ch_latex_showcolumns"><?php echo $strColumnNames; ?></label><br />
  353.                     <table border="0" cellspacing="1" cellpadding="0">
  354.                         <tr>
  355.                             <td>    </td>
  356.                             <td><?php echo $strLatexCaption; ?> </td>
  357.                             <td>
  358.                                 <input type="text" name="latex_data_caption" size="30" value="<?php echo $strLatexContent; ?>" class="textfield" style="vertical-align: middle" />
  359.                             </td>
  360.                         </tr>
  361.                         <tr>
  362.                             <td> </td>
  363.                             <td><?php echo $strLatexContinuedCaption; ?> </td>
  364.                             <td>
  365.                                 <input type="text" name="latex_data_continued_caption" size="30" value="<?php echo $strLatexContent . ' ' . $strLatexContinued; ?>" class="textfield" style="vertical-align: middle" />
  366.                             </td>
  367.                         </tr>
  368.                         <tr>
  369.                             <td> </td>
  370.                             <td><?php echo $strLatexLabel; ?> </td>
  371.                             <td>
  372.                                 <input type="text" name="latex_data_label" size="30" value="<?php echo $cfg['Export']['latex_data_label']; ?>" class="textfield" style="vertical-align: middle" />
  373.                             </td>
  374.                         </tr>
  375.                         <tr>
  376.                             <td> </td>
  377.                             <td><?php echo $strReplaceNULLBy; ?> </td>
  378.                             <td>
  379.                                 <input type="text" name="latex_replace_null" size="20" value="<?php echo $cfg['Export']['latex_null']; ?>" class="textfield" style="vertical-align: middle" />
  380.                             </td>
  381.                         </tr>
  382.                     </table>
  383.                 </td>
  384.             </tr>
  385.             </table>
  386.             </div>
  387.  
  388.             <!-- CSV options -->
  389.             <div id="csv_options">
  390.             <table width="400" border="0" cellpadding="3" cellspacing="1">
  391.                 <tr><th align="left">
  392.                     <?php echo $strCSVOptions; ?><input type="hidden" name="csv_data" value="csv_data" />
  393.                 </th></tr>
  394.                 <tr>
  395.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  396.                     <table border="0" cellspacing="1" cellpadding="0">
  397.                     <tr>
  398.                         <td>
  399.                             <?php echo $strFieldsTerminatedBy; ?> 
  400.                         </td>
  401.                         <td>
  402.                             <input type="text" name="separator" size="2" value="<?php echo $cfg['Export']['csv_separator']; ?>" class="textfield" style="vertical-align: middle" />
  403.                         </td>
  404.                     </tr>
  405.                     <tr>
  406.                         <td>
  407.                             <?php echo $strFieldsEnclosedBy; ?> 
  408.                         </td>
  409.                         <td>
  410.                             <input type="text" name="enclosed" size="2" value="<?php echo $cfg['Export']['csv_enclosed']; ?>" class="textfield" style="vertical-align: middle" />
  411.                         </td>
  412.                     </tr>
  413.                     <tr>
  414.                         <td>
  415.                             <?php echo $strFieldsEscapedBy; ?> 
  416.                         </td>
  417.                         <td>
  418.                             <input type="text" name="escaped" size="2" value="<?php echo $cfg['Export']['csv_escaped']; ?>" class="textfield" style="vertical-align: middle" />
  419.                         </td>
  420.                     </tr>
  421.                     <tr>
  422.                         <td>
  423.                             <?php echo $strLinesTerminatedBy; ?> 
  424.                         </td>
  425.                         <td>
  426.                             <input type="text" name="add_character" size="2" value="<?php if ($cfg['Export']['csv_terminated'] == 'AUTO') echo ((PMA_whichCrlf() == "\n") ? '\n' : '\r\n'); else echo $cfg['Export']['csv_terminated']; ?>" class="textfield" style="vertical-align: middle" />
  427.                         </td>
  428.                     </tr>
  429.                     <tr>
  430.                         <td>
  431.                             <?php echo $strReplaceNULLBy; ?> 
  432.                         </td>
  433.                         <td>
  434.                             <input type="text" name="csv_replace_null" size="20" value="<?php echo $cfg['Export']['csv_null']; ?>" class="textfield" style="vertical-align: middle" />
  435.                         </td>
  436.                     </tr>
  437.                 </table>
  438.                 <input type="checkbox" name="showcsvnames" value="yes" id="checkbox_dump_showcsvnames" <?php PMA_exportCheckboxCheck('csv_columns'); ?> style="vertical-align: middle" /><label for="checkbox_dump_showcsvnames"><?php echo $strPutColNames; ?></label>
  439.             </td>
  440.         </tr>
  441.         </table>
  442.         </div>
  443.  
  444.         <!-- Excel options -->
  445.         <div id="excel_options">
  446.         <table width="400" border="0" cellpadding="3" cellspacing="1">
  447.                 <tr><th align="left">
  448.                     <?php echo $strExcelOptions; ?>
  449.                     <input type="hidden" name="excel_data" value="excel_data" />
  450.                 </th></tr>
  451.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  452.                 <table border="0" cellspacing="1" cellpadding="0">
  453.                     <tr>
  454.                         <td>
  455.                             <?php echo $strReplaceNULLBy; ?> 
  456.                         </td>
  457.                         <td>
  458.                             <input type="text" name="excel_replace_null" size="20" value="<?php echo $cfg['Export']['excel_null']; ?>" class="textfield" style="vertical-align: middle" />
  459.                         </td>
  460.                     </tr>
  461.                     <tr>
  462.                         <td colspan="2">
  463.                             <input type="checkbox" name="showexcelnames" value="yes" id="checkbox_dump_showexcelnames" <?php PMA_exportCheckboxCheck('excel_columns'); ?> style="vertical-align: middle" /><label for="checkbox_dump_showexcelnames"><?php echo $strPutColNames; ?></label>
  464.                         </td>
  465.                     </tr>
  466.                     <tr>
  467.                         <td>
  468.                             <label for="select_excel_edition">
  469.                                 <?php echo $strExcelEdition; ?>: 
  470.                             </label>
  471.                         </td>
  472.                         <td>
  473.                             <select name="excel_edition" id="select_excel_edition" style="vertical-align: middle">
  474.                                 <option value="win"<?php echo $cfg['Export']['excel_edition'] == 'win' ? ' selected="selected"' : ''; ?>>Windows</option>
  475.                                 <option value="mac"<?php echo $cfg['Export']['excel_edition'] == 'mac' ? ' selected="selected"' : ''; ?>>Excel 2003 / Macintosh</option>
  476.                             </select>
  477.                         </td>
  478.                     </tr>
  479.                 </table>
  480.                 </td></tr>
  481.             </table>
  482.             </div>
  483.  
  484.  
  485. <?php if ($xls) { ?>
  486.             <!-- Native Excel options -->
  487.             <div id="xls_options">
  488.                 <table border="0" cellspacing="1" cellpadding="0" width="400">
  489.                     <tr>
  490.                         <th align="left">
  491.                            <b><?php echo $strExcelOptions; ?></b>
  492.                            <input type="hidden" name="xls_data" value="xls_data" />
  493.                         </th>
  494.                    </tr>
  495.                    <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  496.                 <table border="0" cellspacing="1" cellpadding="0">
  497.                        <tr>
  498.                            <td>
  499.                             <?php echo $strReplaceNULLBy; ?> 
  500.                         </td>
  501.                         <td>
  502.                             <input type="text" name="xls_replace_null" size="20" value="<?php echo $cfg['Export']['xls_null']; ?>" class="textfield" />
  503.                         </td>
  504.                     </tr>
  505.                     <tr>
  506.                         <td>
  507.                             <input type="checkbox" name="xls_shownames" value="yes" id="checkbox_dump_xls_shownames" <?php PMA_exportCheckboxCheck('xls_columns'); ?> /><label for="checkbox_dump_xls_shownames"><?php echo $strPutColNames; ?></label>
  508.                         </td>
  509.                     </tr>
  510.                 </table>
  511.                     </td></tr>
  512.                </table>
  513.             </div>
  514. <?php } ?>
  515.  
  516.             <div id="none_options">
  517.             <table width="400" border="0" cellpadding="3" cellspacing="1">
  518.                 <tr><th align="left"><?php echo $strXML; ?></th></tr>
  519.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  520.                     <?php echo $strNoOptions; ?>
  521.                     <input type="hidden" name="xml_data" value="xml_data" />
  522.                 </td></tr>
  523.             </table>
  524.             </div>
  525.             <script type="text/javascript">
  526.             <!--
  527.                 show_checked_option();
  528.             //-->
  529.             </script>
  530.         </td>
  531.     </tr>
  532. <?php
  533. if (isset($table) && !empty($table) && !isset($num_tables)) {
  534. ?>
  535.     <tr>
  536.         <td colspan="3" align="center">
  537.           <div style="background-color: <?php echo $cfg['BgcolorOne']; ?>; padding: 3px; margin: 1px;">
  538.            <b><?php echo sprintf($strDumpXRows , '<input type="text" name="limit_to" size="5" value="' . (isset($unlim_num_rows)?$unlim_num_rows: PMA_countRecords($db, $table, TRUE)) . '" class="textfield" style="vertical-align: middle" onfocus="this.select()" style="vertical-align: middle; text-align: center;" />' , '<input type="text" name="limit_from" value="0" size="5" class="textfield" style="vertical-align: middle" onfocus="this.select()" style="vertical-align: middle; text-align: center;" />') . "\n"; ?></b>
  539.           </div>
  540.         </td>
  541.     </tr>
  542. <?php
  543. }
  544. ?>
  545.  
  546.     <tr>
  547.         <!-- Export to screen or to file -->
  548.         <td colspan="3">
  549.         <table width="100%" border="0" cellpadding="3" cellspacing="1">
  550.         <tr>
  551.             <th align="left">
  552.             <input type="checkbox" name="asfile" value="sendit" id="checkbox_dump_asfile" <?php PMA_exportCheckboxCheck('asfile'); ?> style="vertical-align: middle" /><label for="checkbox_dump_asfile"><b><?php echo $strSend; ?></b></label>
  553.             </th>
  554.         </tr>
  555.         <tr>
  556.             <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  557.                 <?php if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?>
  558.                     <input type="checkbox" name="onserver" value="saveit" id="checkbox_dump_onserver"  onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportCheckboxCheck('onserver'); ?> style="vertical-align: middle" /><label for="checkbox_dump_onserver"><?php echo sprintf($strSaveOnServer, htmlspecialchars($cfg['SaveDir'])); ?></label>,<br />
  559.                     <input type="checkbox" name="onserverover" value="saveitover" id="checkbox_dump_onserverover"  onclick="getElement('checkbox_dump_onserver').checked = true;getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportCheckboxCheck('onserver_overwrite'); ?> style="vertical-align: middle" /><label for="checkbox_dump_onserverover"><?php echo $strOverwriteExisting; ?></label>
  560.                 <br />
  561.                 <?php } ?>
  562.  
  563.                     <?php echo $strFileNameTemplate; ?>: 
  564.                 <input type="text" name="filename_template"
  565.                 <?php
  566.                     echo ' value="';
  567.                     if ($export_type == 'database') {
  568.                         if (isset($_COOKIE) && !empty($_COOKIE['pma_db_filename_template'])) {
  569.                             echo $_COOKIE['pma_db_filename_template'];
  570.                         } else {
  571.                             echo '__DB__';
  572.                         }
  573.                     } elseif ($export_type == 'table') {
  574.                         if (isset($_COOKIE) && !empty($_COOKIE['pma_table_filename_template'])) {
  575.                             echo $_COOKIE['pma_table_filename_template'];
  576.                         } else {
  577.                             echo '__TABLE__';
  578.                         }
  579.                     } else {
  580.                         if (isset($_COOKIE) && !empty($_COOKIE['pma_server_filename_template'])) {
  581.                             echo $_COOKIE['pma_server_filename_template'];
  582.                         } else {
  583.                             echo '__SERVER__';
  584.                         }
  585.                     }
  586.                     echo '" ';
  587.                 ?> style="vertical-align: middle" />
  588.                 (
  589.                 <input type="checkbox" name="remember_template" id="checkbox_remember_template" <?php PMA_exportCheckboxCheck('remember_file_template'); ?> style="vertical-align: middle" /><label for="checkbox_remember_template"><?php echo $strFileNameTemplateRemember; ?></label>
  590.                 )*
  591.  
  592.                 <?php
  593.                 // charset of file
  594.                 if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
  595.                     echo '<br /><label for="select_charset_of_file">' . $strCharsetOfFile . '</label>';
  596.                     echo "\n";
  597.  
  598.                     $temp_charset = reset($cfg['AvailableCharsets']);
  599.                     echo '<select id="select_charset_of_file" name="charset_of_file" size="1">' . "\n"
  600.                             . '                <option value="' . $temp_charset . '"';
  601.                     if ($temp_charset == $charset) {
  602.                         echo ' selected="selected"';
  603.                     }
  604.                     echo '>' . $temp_charset . '</option>' . "\n";
  605.                     while ($temp_charset = next($cfg['AvailableCharsets'])) {
  606.                         echo '                <option value="' . $temp_charset . '"';
  607.                         if ($temp_charset == $charset) {
  608.                             echo ' selected="selected"';
  609.                         }
  610.                         echo '>' . $temp_charset . '</option>' . "\n";
  611.                     } // end while
  612.                     echo '            </select>';
  613.                 } // end if
  614.                 echo "\n";
  615.                 ?>
  616.                 <br />
  617.                     <b><?php echo $strCompression; ?></b><br />
  618.                         <input type="radio" name="compression" value="none" id="radio_compression_none" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'none'); ?> style="vertical-align: middle" /><label for="radio_compression_none"><?php echo $strNone; ?></label>
  619.   
  620.  
  621. <?php
  622.  
  623. // zip, gzip and bzip2 encode features
  624. $is_zip  = (isset($cfg['ZipDump']) && $cfg['ZipDump'] && @function_exists('gzcompress'));
  625. $is_gzip = (isset($cfg['GZipDump']) && $cfg['GZipDump'] && @function_exists('gzencode'));
  626. $is_bzip = (isset($cfg['BZipDump']) && $cfg['BZipDump'] && @function_exists('bzcompress'));
  627. if ($is_zip || $is_gzip || $is_bzip) {
  628.     if ($is_zip) {
  629.         ?>
  630.                 <input type="radio" name="compression" value="zip" id="radio_compression_zip" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'zip'); ?> style="vertical-align: middle" /><label for="radio_compression_zip"><?php echo $strZip; ?></label><?php echo (($is_gzip || $is_bzip) ? '  ' : ''); ?>
  631.         <?php
  632.     }
  633.     if ($is_gzip) {
  634.         echo "\n"
  635.         ?>
  636.                 <input type="radio" name="compression" value="gzip" id="radio_compression_gzip" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'gzip'); ?> style="vertical-align: middle" /><label for="radio_compression_gzip"><?php echo $strGzip; ?></label><?php echo ($is_bzip ? '  ' : ''); ?>
  637.         <?php
  638.     }
  639.     if ($is_bzip) {
  640.         echo "\n"
  641.         ?>
  642.                 <input type="radio" name="compression" value="bzip" id="radio_compression_bzip" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'bzip'); ?> style="vertical-align: middle" /><label for="radio_compression_bzip"><?php echo $strBzip; ?></label>
  643.         <?php
  644.     }
  645. }
  646. echo "\n";
  647. ?>
  648.             </td>
  649.         </tr>
  650.         </table>
  651.         </td>
  652.     </tr>
  653.  
  654. <?php
  655. // Encoding setting form appended by Y.Kawada
  656. if (function_exists('PMA_set_enc_form')) {
  657.     ?>
  658.     <tr>
  659.         <!-- Japanese encoding setting -->
  660.         <td colspan="3" align="center">
  661.     <?php
  662.     echo PMA_set_enc_form('            ');
  663.     ?>
  664.         </td>
  665.     </tr>
  666.     <?php
  667. }
  668. echo "\n";
  669. ?>
  670.     <tr>
  671.         <td colspan="3" align="right" class="tblFooters">
  672.             <input type="submit" value="<?php echo $strGo; ?>" id="buttonGo" />
  673.         </td>
  674.     </tr>
  675.     </table>
  676. </form>
  677. <br />
  678. <table border="0" cellpadding="0" cellspacing="0" width="600">
  679. <tr>
  680.     <td valign="top">* </td>
  681.     <td>
  682.         <?php echo sprintf($strFileNameTemplateHelp, '<a href="http://www.php.net/manual/function.strftime.php" target="documentation" title="' . $strDocu . '">', '</a>') . "\n"; ?>
  683.  
  684.     </td>
  685. </tr>
  686. </table>
  687.